import 'package:flutter_fronter_service/generated/json/base/json_field.dart';
import 'package:flutter_fronter_service/generated/json/order_entity.g.dart';
import 'dart:convert';

import 'OrderDetail.dart';
import 'address_entity.dart';
export 'package:flutter_fronter_service/generated/json/order_entity.g.dart';

@JsonSerializable()
class OrderEntity {
	late int id = 0;
	late String orderRemark = '';
	late String deliveryTime = '';
	late int orderAmount = 0;
	late int createTime = 0;
	late int updateTime = 0;
	late int orderState = 0;// 订单状态 0:待支付 1:待发货 2:待收货 3:待评价 4:已完成
	late AddressEntity addressEntity;
	late List<OrderDetail> orderDetails = [];


	OrderEntity();

	factory OrderEntity.fromJson(Map<String, dynamic> json) => $OrderEntityFromJson(json);

	Map<String, dynamic> toJson() => $OrderEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}